home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uconv / nsIUnicodeDecodeHelper.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  118 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIUnicodeDecodeHelper_h___
  39. #define nsIUnicodeDecodeHelper_h___
  40.  
  41. #include "nscore.h"
  42. #include "uconvutil.h"
  43. #include "nsISupports.h"
  44. #include "nsIMappingCache.h"
  45.  
  46. // Interface ID for our Unicode Decode Helper interface
  47. // {9CC39FF0-DD5D-11d2-8AAC-00600811A836}
  48. #define NS_IUNICODEDECODEHELPER_IID \
  49. { 0x9cc39ff0, 0xdd5d, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
  50.  
  51. // Class ID for our UnicodeDecoderHelper implementation
  52. // {9CC39FF1-DD5D-11d2-8AAC-00600811A836}
  53. #define NS_UNICODEDECODEHELPER_CID \
  54. {  0x9cc39ff1, 0xdd5d, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
  55.  
  56. #define NS_UNICODEDECODEHELPER_CONTRACTID "@mozilla.org/intl/unicode/decodehelper;1"
  57.  
  58. #define NS_ERROR_UDEC_NOHELPER  \
  59.   NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_UCONV, 0x41)
  60.  
  61. //----------------------------------------------------------------------
  62. // Class nsIUnicodeDecodeHelper [declaration]
  63.  
  64. /**
  65.  * Interface for a Unicode Decode Helper object.
  66.  * 
  67.  * @created         22/Feb/1999
  68.  * @author  Catalin Rotaru [CATA]
  69.  */
  70. class nsIUnicodeDecodeHelper : public nsISupports
  71. {
  72. public:
  73.    NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUNICODEDECODEHELPER_IID)
  74.  
  75.   /**
  76.    * Converts data using a lookup table.
  77.    */
  78.   NS_IMETHOD ConvertByTable(const char * aSrc, PRInt32 * aSrcLength, 
  79.       PRUnichar * aDest, PRInt32 * aDestLength, uShiftTable * aShiftTable, 
  80.       uMappingTable * aMappingTable) = 0;
  81.  
  82.   /**
  83.    * Converts data using a set of lookup tables.
  84.    */
  85.   NS_IMETHOD ConvertByMultiTable(const char * aSrc, PRInt32 * aSrcLength, 
  86.       PRUnichar * aDest, PRInt32 * aDestLength, PRInt32 aTableCount, 
  87.       const uRange * aRangeArray, uShiftTable ** aShiftTable, 
  88.       uMappingTable ** aMappingTable) = 0;
  89.  
  90.   /**
  91.    * Converts data using a fast lookup table.
  92.    */
  93.   NS_IMETHOD ConvertByFastTable(const char * aSrc, PRInt32 * aSrcLength, 
  94.       PRUnichar * aDest, PRInt32 * aDestLength, const PRUnichar * aFastTable, 
  95.       PRInt32 aTableSize) = 0;
  96.  
  97.   /**
  98.    * Create a Mapping Cache
  99.    */
  100.  
  101.   NS_IMETHOD CreateCache(nsMappingCacheType aType, nsIMappingCache* aResult) = 0;
  102.   /**
  103.    * Destroy a Mapping Cache
  104.    */
  105.  
  106.   NS_IMETHOD DestroyCache(nsIMappingCache aCache) = 0;
  107.  
  108.  
  109.   /**
  110.    * Create a cache-like fast lookup table from a normal one.
  111.    */
  112.   NS_IMETHOD CreateFastTable( uShiftTable * aShiftTable, 
  113.       uMappingTable * aMappingTable, PRUnichar * aFastTable, 
  114.       PRInt32 aTableSize) = 0;
  115. };
  116.  
  117. #endif /* nsIUnicodeDecodeHelper_h___ */
  118.